package com.erp.service.produtc.impl;

import com.erp.domain.ErpProduct;
import com.erp.mapper.product.ProductMapper;
import com.erp.service.produtc.IProductService;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * --- 代码敲对！ ---
 *
 * @author CCCccc
 * @create 2025/9/3
 * 备注：商品信息业务层实现类
 */
@Service
public class ProductServiceImpl implements IProductService {
    // 自动注入
    @Autowired
    private ProductMapper productMapper;

    // 查询商品信息列表
    @Override
    public List<ErpProduct> list(ErpProduct erpProduct) {

        return productMapper.List(erpProduct);
    }

    // 新增商品
    @Override
    public int add(ErpProduct erpProduct) {
        return productMapper.add(erpProduct);
    }

    // 更新商品信息
    @Override
    public int update(@RequestBody ErpProduct erpProduct) {
        return productMapper.update(erpProduct);
    }
}
